/*
* PROJECT: Happy New Year
* VERSION: 1.0
* AUTHOR: Mattias Thell
* URL: http://www.mattiasthell.com
*
* */

#pragma once

#include <hgevector.h>

#include "Geometry.hpp"

namespace hny {

	typedef enum ActorKind_ {
		Kind_NULL = 0,
		Kind_Rocket,
		Kind_Explosion,
		Kind_Text,
		Kind_MAX
	} ActorKind;

	typedef unsigned int IdType;
	typedef unsigned int TypeType;

	class World;

	class Actor
	{
	public:
		Actor(World* world, TypeType type);
		virtual ~Actor();

		virtual void Update(float deltaTime) = 0;
		virtual void Draw() = 0;

		virtual void OnDeath();

		bool CollidesWith(const Actor& actor);
		bool CollidesWith(Circle c);

		const hgeVector& GetPosition() const;
		void SetPosition(const hgeVector& pos);

		const hgeVector& GetVelocity() const;
		void SetVelocity(const hgeVector& vel);

		bool IsCollidable() const;
		void SetCollidable(bool c);

		float GetRadius() const;
		void SetRadius(float radius);

		bool IsAlive() const;
		bool IsDying() const;
		void SetIsDying();
		void Kill();


		World* GetWorld() const;

		IdType GetId() const;
		TypeType GetKind() const;

	private:
		// The world to which this actor belongs
		World* mWorld;

		// Positional info
		hgeVector mPosition;
		hgeVector mVelocity;
		
		// Collision stuff
		bool mCollidable;
		float mRadius;

		// Book-keeping
		bool mAlive;
		bool mIsDying;
		IdType mId;
		TypeType mKind;
		
	};
}
